package pack1;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBconn {
	
	private static Connection con = null;
	
	public static Connection getConn(){
		
		try
		{
			if(con == null){ 
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=G:/Program Files/MSAccessDBTest/MSDBTest.mdb";
			con = DriverManager.getConnection(url,"","");
			}
			
		}catch(Exception e){
			e.printStackTrace();
		}
		return con;
	}

}
